
<template>
  <div>
    <vol-box
      :lazy="true"
      v-model="dialogVisible"
      title="选择BOM"
      :height="500"
      :width="1000"
      :padding="10"
      :draggable=true
    >
      <div>
        <span><dj_stpo_mara_view ref="dj_stpo_mara_view"></dj_stpo_mara_view></span>
      </div>
      <template #footer>
        <div>
          <el-button type="primary" size="mini" @click="other_handle"
            >确认选中</el-button
          >
          <el-button type="default" size="mini" @click="dialogVisible = false"
            >关闭</el-button
          >
        </div></template
      >
    </vol-box>
  </div>
</template>

    <script>
import VolBox from "@/components/basic/VolBox.vue";
import dj_stpo_mara_view from "@/views/djerp/dj_base_data/dj_stpo_mara_view.vue";

import http from "@/../src/api/http.js";
export default {
  components: { dj_stpo_mara_view, VolBox },
  data() {
    return {
      dialogVisible: false,
    };
  },
  setup() {},
  destroyed() {},
  mounted() {},
  methods: {
    open_w() {
      this.dialogVisible = true;
      
    },
    other_handle() {
      let row = this.$refs.dj_stpo_mara_view.$refs.grid.getSelectRows();
      if (row.length == 0) {
        this.$message.error("请选择一个BOM头物料");
        return;
      }
      this.$parent.$parent.$parent.bom_input=row[0].idnrk
     // console.log(this.$parent.$parent.$parent);

      this.dialogVisible = false;
    },
  },
};
</script>